//
//  CategoriesViewController.h
//  MemoryTasks
//
//  Created by Philippe Bouamriou on 12/05/10.
//  Copyright 2010 Philippe Bouamriou. All rights reserved.
//

#import <UIKit/UIKit.h>

@class TaskCategory;
@class CategoriesViewController;


typedef enum {
   kCategoriesViewModeEdition = 0 /* Default value */,
   kCategoriesViewModeSelection
} CategoriesViewMode;

@protocol CategoriesSelectionDelegate

- (void)categoriesViewController:(CategoriesViewController *)categoryViewCtrl 
               didSelectCategory:(TaskCategory *)category 
                  withIdentifier:(NSUInteger)identifier;

@end


@interface CategoriesViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
   UINavigationController *navController;
   UITableView *categoryTableView;
   NSArray *categories;
   TaskCategory *parentCategory;
   CategoriesViewMode viewMode;
   id<CategoriesSelectionDelegate> delegate;
   NSUInteger identifier;
}

@property (nonatomic, strong) IBOutlet UINavigationController *navController;
@property (nonatomic, strong) IBOutlet UITableView *categoryTableView;
@property (nonatomic, strong) NSArray *categories;
@property (nonatomic, strong) TaskCategory *parentCategory;
@property CategoriesViewMode viewMode;
@property (nonatomic, strong) id<CategoriesSelectionDelegate> delegate;
@property NSUInteger identifier;

- (IBAction)addButtonPressed;
- (void)reloadData;
- (void)reloadDataWithTable:(BOOL)reloadTable;

@end
